// const ScriptSetup = require('unplugin-vue2-script-setup/webpack').default;
const path = require('path')

module.exports = {
	pluginOptions: {
		'style-resources-loader': {
			preProcessor: 'scss',
			patterns: [
				// 添加全局引入的scss样式文件路径
				path.resolve(__dirname, 'uview-ui/index.scss'),
			]
		}
	},
	parallel: false,
	configureWebpack: {
		devServer: {
			disableHostCheck: true,
			proxy: {
				'/api': {
					target: 'https://shop1.gluz.com.cn/', // 目标 API 服务器
					changeOrigin: true,
					secure: true,
					pathRewrite: {
						'^/api': ''
					}, // 可选，重写路径
				}
			}
		},
		plugins: [
			// ScriptSetup({
			// 	/* options */
			// }),
		],
	},

	chainWebpack(config) {
		// disable type check and let `vue-tsc` handles it
		config.plugins.delete('fork-ts-checker');
	},
};